#ifndef IMAGEMANAGER_H
#define IMAGEMANAGER_H

#include <QImage>
#include <QPixmap>
#include <QFile>
#include <QMessageBox>

class ImageManager
{
private:
    QSize DefaultImportSize;
    QImage *OriginalImage;
    QImage *WorkingImage;
    QImage *PreviewImage;

    QPixmap *DisplayableWorkingImage;
    QPixmap *DisplayablePreviewImage;



    void rebuildDisplayableWorkingImage();
    void rebuildDisplayablePreviewImage();

public:
    ImageManager();

    QPixmap * getDisplayableWorkingImage();
    QPixmap * getDisplayablePreviewImage();

    void setImportSize(QSize s);

    void loadOriginalImageFromFile(QString filepath);
    void copyWorkingImageToOriginalImage();
    void exportWorkingImage(QString filepath, QImage * img);
    void reset();
    void resetPreview();

    QImage * getWorkingImage();
    QImage * getPreviewImage();

    void setPreviewImage(QImage *img);
    void setWorkingImage(QImage *img);

    bool isOriginalImageLoaded();
};

#endif // IMAGEMANAGER_H
